package com.dlc.shop.service;



import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dlc.shop.bean.dto.UserWithDrawDTO;
import com.dlc.shop.bean.model.UserWithdrawCash;
import com.dlc.shop.bean.vo.DateUserWithdrawCashVO;
import com.dlc.shop.bean.vo.UserWithdrawCashVO;
import com.dlc.shop.bean.vo.UserWithdrawInfoVO;
import com.dlc.shop.common.allinpay.order.resp.PayByBackSmsResp;
import com.dlc.shop.common.allinpay.order.resp.WithdrawApplyResp;
import com.dlc.shop.common.util.PageParam;

import java.math.BigDecimal;

/**
 * @author gaozijie
 * @date 2023-04-24
 */
public interface UserWithdrawCashService extends IService<UserWithdrawCash> {

    /**
     * 提现申请
     * @param withDrawDTO
     * @return
     */
    WithdrawApplyResp withdrawApply(UserWithDrawDTO withDrawDTO);

    /**
     * 提现确认支付
     * @param userWithDrawDTO
     * @return
     */
    PayByBackSmsResp payConfirm(UserWithDrawDTO userWithDrawDTO);

    /**
     * 通过bizOrderNo获取提现记录
     * @param bizOrderNo 第三方订单号(通联)
     * @return
     */
    UserWithdrawCash getByBizOrderNo(String bizOrderNo);

    /**
     * 更新提现记录
     * @param userWithdrawCash
     */
    void update(UserWithdrawCash userWithdrawCash);

    /**
     * 获取用户提现总金额
     * @param userId
     * @return
     */
    BigDecimal getTotalWithdrawAmount(String userId);

    /**
     * 分页获取用户提现记录
     * @param userId
     * @param pageParam
     * @return
     */
    IPage<UserWithdrawCashVO> pageUserWithdrawCashVOList(String userId, PageParam<UserWithdrawCash> pageParam);

    /**
     * 分页获取按年月分组的用户提现记录
     * @param userId
     * @param pageParam
     * @return
     */
    IPage<DateUserWithdrawCashVO> pageDateUserWithdrawCashVOList(String userId, PageParam<UserWithdrawCash> pageParam);

    /**
     * 用户提现回调处理
     * @param bizOrderNo 订单号
     * @param payStatus 支付状态
     * @param payFailMessage 支付失败信息
     * @return
     */
    public void withdrawBack(String bizOrderNo,
                             String payStatus,
                             String payFailMessage);

    /**
     * 获取用户提现信息
     * @param userId 用户id
     * @return 用户提现信息
     */
    UserWithdrawInfoVO getUserWithdrawInfo(String userId);
}
